<html>
<head><meta charset="utf-8"><title>Status of core::io::{Error, Read, Write} · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html">Status of core::io::{Error, Read, Write}</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228284042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228284042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Colin Finck <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228284042">(Mar 01 2021 at 18:42)</a>:</h4>
<p>Hey all! I read through all discussions about stabilizing the <code>Error</code>, <code>Read</code>, and <code>Write</code> traits of <code>std::io</code> into <code>core::io</code>, and this is the last thread I found: <a href="https://github.com/rust-lang-nursery/portability-wg/issues/12">https://github.com/rust-lang-nursery/portability-wg/issues/12</a><br>
Are we all just waiting for someone to open a Pull Request? Or what is the actual blocker?</p>
<p>Creating a generic <code>core::io::Error</code> that <code>std::io::Error</code> implements doesn't sound too difficult.<br>
I could probably do that, but can't really believe it's that simple, after at least 5 years of discussion and 3 crates doing the same thing...</p>



<a name="228301329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228301329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228301329">(Mar 01 2021 at 20:34)</a>:</h4>
<p>same as always: core doesn't allocate.</p>



<a name="228301401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228301401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228301401">(Mar 01 2021 at 20:34)</a>:</h4>
<p>i believe the error working group has some stuff in mind.</p>



<a name="228306760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228306760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Colin Finck <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228306760">(Mar 01 2021 at 21:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> Well, I imagine one could make <code>core::io::Error</code> a static enum with just enough options to cover <code>core::io::Read</code> and <code>core::io::Write</code>. The <code>std</code> versions could then map these error codes to their <code>std::io::Error</code> counterparts. What am I missing?</p>



<a name="228306904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228306904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228306904">(Mar 01 2021 at 21:12)</a>:</h4>
<p><span class="user-mention" data-user-id="350190">@Colin Finck</span> does that actually help? that means <code>core::Error</code> and <code>std::Error</code> can't be used interchangeably</p>



<a name="228306935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228306935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228306935">(Mar 01 2021 at 21:12)</a>:</h4>
<p>oh my apologies, i was thinking of std::error::Error, which is the offender here.</p>



<a name="228308287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Status%20of%20core%3A%3Aio%3A%3A%7BError%2C%20Read%2C%20Write%7D/near/228308287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Colin Finck <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Status.20of.20core.3A.3Aio.3A.3A.7BError.2C.20Read.2C.20Write.7D.html#228308287">(Mar 01 2021 at 21:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> I see. But then, what's the alternative?<br>
Now that <code>std::io::Error</code> is stabilized and allocates, I don't think we can ever get a compatible error type to <code>core</code>, can we?</p>
<p>This way, we could at least develop no_std crates against the same <code>Read</code> and <code>Write</code> traits, and easily make them std-compatible if we also stabilize the "core-io to std-io" conversion code.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>